<?php
if ( !defined('IN_ADMINCP') || !defined('IN_SEC') ){
	exit('Access Denied.');
}

define('UAC_LEVEL', 5);

$heivrid = $_G['gp_heivrid'];
$settingmode = $_G['gp_settingmode'];

$admin = $heivrid ? fetch('admincp_member', $heivrid, 'username') : $admincp->admin;
$admin = $admin ? $admin : $admincp->cpmsg('成员不存在');

$profile = ($admin['id'] == $admincp->adminid);

$profile = $_G['gp_profile'] ? 0 : $profile;

$companys = parse_array(limitquery('companys'));
$departments = parse_array(limitquery('admincp_department'));

$department = $departments[$admin['departmentid']];
$group = $admincp->groups[$admin['groupid']];

$activities = limitquery('admincp_member_activities', array('adminid' => $admin['id']), array('order' => 'ORDER BY `id` DESC'));

$department_members = limitquery('admincp_member', array('departmentid' => $admin['departmentid'], 'companyid' => $admin['companyid']));

if( is_post() ){
	if( !confirm_password($admincp->admin) ){
		$admincp->cpmsg('密码不正确！授权操作失败！');
	}
	unset($admincp->admin['group']);
	$account = new admincp_account();
	$account->edit($admincp->admin);
	$admincp->success();
}

?>